<template>
    <div :id="props.id" :style="props.style"></div>
</template>
<script>
    import echarts from 'echarts'
    export default {
        props: [`props`],
        methods: {
            drawEcharts (id) {
                this.chart = echarts.init(document.getElementById(id));
                this.chart.setOption(this.props.option)
            }
        },
        mounted() {
            this.$nextTick(function () {
                this.drawEcharts(this.props.id)
            })
        }
    }
</script>